package java07;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;

public class zy05{
    public static void main(String[] args) {
        String inputFile = "input.txt";
        String outputFile = "output.txt";

        try (BufferedReader reader = new BufferedReader(new FileReader(inputFile));
             FileWriter writer = new FileWriter(outputFile)) {
            String line = reader.readLine();
            if (line != null) {
                String[] numbers = line.split("-");
                int[] intNumbers = new int[numbers.length];
                for (int i = 0; i < numbers.length; i++) {
                    intNumbers[i] = Integer.parseInt(numbers[i]);
                }
                Arrays.sort(intNumbers);
                for (int i = 0; i < intNumbers.length; i++) {
                    writer.write(intNumbers[i] + (i < intNumbers.length - 1 ? "-" : ""));
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
